/*
 *  Copyright 2009 David Kuhn <david.s.kuhn at gmail.com>.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package com.google.code.teamtools.service;

import java.util.List;

import com.google.code.teamtools.domain.IProject;
import com.google.code.teamtools.domain.ITeam;
import com.google.code.teamtools.domain.impl.Employee;

/**
 * 
 * @author David Kuhn
 */
public interface IEmployeeService
{
	/**
	 * Deletes the <tt>Employee</tt> specified.
	 * 
	 * @param employee the <tt>Employee</tt> to delete
	 */
	void delete(Employee employee);
	
	/**
	 * Deletes the <tt>Employee</tt> with the specified ID.
	 * 
	 * @param id the ID of the <tt>Employee</tt> to delete.
	 */
	void deleteById(Long id);
	
    /**
     * Retrieves the employee with the specified ID. If no employee exists
     * with the ID provided then <tt>null</tt> is returned.
     * 
     * @param id the ID of the employee to retrieve
     * @return the employee or <tt>null</tt> if not found
     */
    Employee getEmployeeById(Long id);
    
	/**
	 * Returns a list of all employees.
	 * 
	 * @return a list of employees
	 */
	List<Employee> getEmployees();
	
	/**
     * Return all employees that have worked on <tt>IProject</tt>. Returns 
     * <tt>null</tt> if no employees found for the project provided.
     * 
     * @param project the project of the employees to return
     * @return a list of employees or <tt>null</tt>
     */
    List<Employee> getEmployeesByProject(IProject project);
    
	/**
	 * Return all employees that belong to the given <tt>ITeam</tt>. Returns 
	 * <tt>null</tt> if no employees found belonging to the team provided.
	 * 
	 * @param team the team of the employees to return
	 * @return a list of employees or <tt>null</tt>
	 */
	List<Employee> getEmployeesByTeam(ITeam team);
	
	/**
     * Saves a new employee entity or updates an exiting one.
     * 
     * @param employee the <code>Employee</code> to save or update
     */
    void saveOrUpdate(Employee employee);
}
